package com.wshare.dao.impl;

import java.util.List;





import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.wshare.dao.interfaces.IRoleDao;
import com.wshare.entity.Role;

@Repository
@Transactional
public class RoleDaoImpl implements IRoleDao{

	@Autowired
	SessionFactory sessionFactory;
	@Override
	public List<Role> getByCol(String col, Object val) {
		Session session = sessionFactory.getCurrentSession();
		List lrole = session
				.createCriteria(Role.class)
				.add(Restrictions.eq(col,val)).list();
		return lrole;
	}

}
